
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>抽屉组件2</title>
  <link href="/app/admin/component/pear/css/pear.css" rel="stylesheet" />
  <style>
    .wrap {
      display: none;
    }
  </style>
</head>
<body class="pear-container">
<div class="layui-row layui-col-space10">
  <div class="layui-col-md12">
    <div class="layui-card">
      <div class="layui-card-header">功能提示</div>
      <div class="layui-card-body">
        <div>配合数据库CURD的控件参数使用，点击快速复制对应的动态参数</div>
        <div>增加动态参数，请在 \app\admin\utils\controller\FormatController 中新增</div>
      </div>
    </div>
  </div>

	{foreach $list as  $groupname => $items}
	<div class="layui-col-md12">
		<div class="layui-card">
			<div class="layui-card-header">
				{$groupname}
			</div>
			<div class="layui-card-body">
				{foreach $items as $key=>$item}
					{if $item['type']=='form'}
				<button data-text="{$item['text']??''}" class="drawer-top pear-btn pear-btn-primary" title="参数信息：{$item['text']??''}">{$item['name']}</button>
				{else}
				<button data-text="{$path}{$key}" class="drawer-top pear-btn pear-btn-primary" title="参数信息：{$item['idField']??''} - {$item['nameField']??''}">{$item['name']}</button>
				{/if}
				{/foreach}
			</div>
		</div>
	</div>
	{/foreach}
</div>

</body>

<script src="/app/admin/component/layui/layui.js"></script>
<script src="/app/admin/component/pear/pear.js"></script>
<script src="/app/admin/admin/js/common.js"></script>

<script>
  layui.use(['element', 'jquery', 'drawer', 'layer', 'code'], function() {
    var element = layui.element;
    var $ = layui.jquery;
    var drawer = layui.drawer;
    var layer = layui.layer;


    $(".drawer-top").click(function () {
      	if(copy_text($(this).data('text'))){
			  layer.msg('复制成功',{icon:1})
		}else{
			layer.msg('复制成功',{icon:5})
		}
    })
  })
</script>
</html>
